package com.ITArmy.service;

import com.ITArmy.beans.Shows.UserMassage;
import com.ITArmy.beans.User;
import com.ITArmy.common.ServerResponse;
import org.springframework.ui.Model;
import org.springframework.web.multipart.MultipartFile;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.List;


public interface UserService {
    /**
     * 添加用户信息
     *
     * @param user user
     * @return ServerResponse
     */
    ServerResponse addUser(User user);

    /**
     * 遍历用户信息
     *
     * @return ServerResponse
     */
    List<User> findAllUser();

    /**
     * 进入主页面
     *
     * @param request  request
     * @param response response
     * @param model    model
     */
    void goIndexPage(HttpServletRequest request, HttpServletResponse response, Model model);

    /**
     * 进入后台页面
     *
     * @param request  request
     * @param response response
     * @param model    ServerResponse
     */
    void goBackPage(HttpServletRequest request, HttpServletResponse response, int page, Model model);

    /**
     * 用户注册
     *
     * @param user user
     * @param req  req
     * @param code code
     * @return ServerResponse
     */
    ServerResponse register(User user, HttpServletRequest req, String code);

    /**
     * 获取用户的基本信息
     *
     * @param req   req
     * @param model model
     * @return ServerResponse
     */
    ServerResponse getUser(HttpServletRequest req, Model model);

    /**
     * 根据email查询用户
     *
     * @param Email email
     * @return ServerResponse
     */
    ServerResponse inquireEmail(String Email);

    /**
     * 验证登录
     *
     * @param uEmail    uemail
     * @param uPwd      upwd
     * @param req       req
     * @param resp      resp
     * @param freeLogin freelogin
     * @param model     model
     * @return ServerResponse
     */
    ServerResponse checkLogin(String uEmail, String uPwd, HttpServletRequest req, HttpServletResponse resp, boolean freeLogin, Model model);

    /**
     * 修改用户的信息
     *
     * @param user user
     * @return ServerResponse
     */
    ServerResponse updateUser(User user, HttpServletRequest request);

    /**
     * 上传用户头像
     *
     * @param uHeaed uhead
     * @param req    req
     * @return ServerResponse
     */
    ServerResponse uploadHead(MultipartFile uHeaed, HttpServletRequest req);

    /**
     * 注销用户（删除用户，用户本身的自己的 注销用户的信息）
     *
     * @param req  req
     * @param resp resp
     * @return ServerResponse
     */
    ServerResponse deleteUser(HttpServletRequest req, HttpServletResponse resp);

    /**
     * 管理员批量删除用户信息
     *
     * @param uId uid
     * @return ServerResponse
     */
    ServerResponse deleteUserByManager(long uId);

    /**
     * 批量删除
     *
     * @param ids ids
     * @return ServerResponse
     */
    ServerResponse deleteManyByIds(String[] ids);

    /**
     * 用户退出登录（清除session和cookie）
     *
     * @param req  req
     * @param resp resp
     * @return ServerResponse
     */
    ServerResponse loginOut(HttpServletRequest req, HttpServletResponse resp);

    /**
     * 用户开通vip
     *
     * @param email email
     * @return ServerResponse
     */
    ServerResponse openVip(String email);

    /**
     * 用户充值
     *
     * @param money money
     * @return ServerResponse
     */
    ServerResponse charge(double money);

    /**
     * 用户找回密码
     *
     * @param email email
     * @return ServerResponse
     */
    ServerResponse findPwd(String email);

    /**
     * 用户购买连载
     *
     * @param serializeId serializeId
     * @return ServerResponse
     */
    ServerResponse buySerialize(long serializeId);

    /**
     * 用户点赞连载
     */
    public void sikp(HttpServletRequest request, HttpServletResponse response);

    /**
     * 根据用户的id进行查询用户的信息
     */
    public ServerResponse findUserById(long uId);

    /**
     * 进行金币的减少()
     */
    public ServerResponse reduceGold(HttpServletRequest request, int amount);

    /**
     * 进入个人主页，需要显示，获取赞数量，关注别人的数量，粉丝数量，文章数量
     */
    public UserMassage showPersonalMassage(HttpServletRequest request);

    /**
     * 进入其他用户的主页，进行展示信息
     */
    public UserMassage showOtherMassage(long uId);
}
